package com.bytech.common.biz.service.remote.comment;

import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bytech.common.biz.entity.base.BaseResult;
import com.bytech.common.biz.entity.emoticon.Emoticon;
import com.bytech.common.biz.entity.emoticon.EmoticonDto;
import com.bytech.common.biz.entity.emoticon.EmoticonQuery;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 远程博客评论服务客户端
 *
 * @Author Zhao
 * @Create 2021/8/10 18:52
 */
@FeignClient("service-blog-comment")
public interface RemoteCommentService {

    @GetMapping("/comment/countByType")
    BaseResult<Integer> countByType(@RequestParam("type") String type);

    @GetMapping("/comment/countByArticle")
    BaseResult<Integer> countByArticle(@RequestParam("articleId") String articleId);

    @PostMapping("/comment/deleteByArticleId")
    BaseResult<Integer> deleteByArticleId(@RequestParam("articleId") String articleId);

    /**
     * 表情包相关接口
     */
    @PostMapping("/emoticon/pageByQuery")
    Page<EmoticonDto> pageEmoticonByQuery(@RequestBody EmoticonQuery<Emoticon> query);

    @PostMapping("/emoticon/batchAdd")
    BaseResult<?> doBatchAddEmoticon(@RequestBody List<Emoticon> emoticonList);

    @PostMapping("/emoticon/deleteById")
    BaseResult<?> doDeleteEmoticonById(@RequestParam("id") Long id);

    @PostMapping("/emoticon/toggleUsable")
    BaseResult<?> doToggleEmoticonUsable(@RequestParam("id") Long id);

    @PostMapping("/emoticon/modifyName")
    BaseResult<?> doModifyEmoticonName(@RequestParam("id") Long id, @RequestParam("name") String name);

}
